ValueFolderTemp='/sps/isc/rneveu/EtudeIRM/Nature/ResultsJournal/';
for n1=1:33
    load([ValuefolderTemp 
VecA=192:1:198;
VecA=[VecA 65];
Veca=224:1:230;
Veca=[Veca 97];
VecC=[199 67];
Vecc=[231 99];
VecE=200:203;
VecE=[VecE 69];
Vece=232:1:235;
Vece=[Vece 101];
VecI=204:207;
VecI=[VecI 73];
Veci=236:1:239;
Veci=[Veci 105];
Vecn=[241 110];
VecO=210:214;
VecO=[VecO 216 79];
Veco=242:1:246;
Veco=[Veco 248 111];
VecU=217:1:220;
VecU=[VecU 85];
Vecu=249:1:252;
Vecu=[Vecu 117];
VecY=[221 89];
Vecy=[253 121];
Vecs=[223 115];
VecSpecialCharacters=[{VecA} {Veca} {VecC} {Vecc} {VecE} {Vece} {VecI} {Veci} {Vecn} {VecO} {Veco} {VecU} {Vecu} {VecY} {Vecy} {Vecs}];
ValueFile=dir([ValueFolderTemp 'ResultsNameAuthors' num2str(n5) '.mat']);
if size(ValueFile,1)==0
    VecResultsAuthorsNameOriginal=zeros(1002,2); % Each line rerpesents the number of authors in the article, the first column represents the number of articles with authors sorted in an alphabetical order and the second column the number of the other articles
    VecResultsAuthorsNameAll=zeros(1002,2); % Each line rerpesents the number of authors in the article, the first column represents the number of articles with authors sorted in an alphabetical order and the second column the number of the other articles
    VecArticleType={'Academic Dissertation' 'Adaptive Clinical Trial' 'Clinical Trial' 'Comparative Study' 'Controlled Clinical Trial' 'Equivalence Trial' 'Evaluation Study' 'Journal Article' 'Meta-Analysis' 'Multicenter Study' 'Observational Study' 'Pragmatic Clinical Trial' 'Randomized Controlled Trial' 'Review' 'Statistics' 'Technical Report' 'Systematic Review' 'Twin Study' 'Validation Study'};
    VecArticleType2={'Review' 'Systematic Review'};
    ValueClock=clock;
    disp(['Start of the processing at ' num2str(ValueClock(1,4)) ':' num2str(ValueClock(1,5)) ':' num2str(ValueClock(1,6)) ' for journal ' num2str(n5)]);
    VecValueDateTemp={'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec'};
    n1Temp2=1;
    try
        ValueFile=['ResultsNameAuthorsTemp' num2str(n5) '.mat'];
        load([ValueFolderTemp ValueFile]);
        n1Temp2=n1;
    end
    n1Temp2=n1Temp2+1;
    for n1=n1Temp2:1062
        n1
        eval(sprintf('load([ValueFolder ''ResultsFile%d.mat'']);',n1));
        % Loop over the articles of each Nature journal separately
        eval(sprintf('VecValueTemp=VecResult2Journal%d;',n5));
        for n3=1:size(VecValueTemp,1)
            ValueTemp=VecValueTemp{n3,1};
            [ValueFirst,ValueLast,ValueAffiliation,ValueORCID,nAuthors]=ExtractAuthor(ValueTemp,0,1);
            ValueArticleType=ComputeArticleType(VecValueTemp{n3,9},VecArticleType,VecValueTemp{n3,10},VecValueTemp{n3,11});
            if ValueArticleType>0
                if nAuthors>1
                    ValueArticleType3=1;
                else
                    if nAuthors==1
                        ValueArticleType3=2;
                    else
                        ValueArticleType3=3;
                    end
                end
            else
                ValueArticleType3=0;
            end
            if size(ValueTemp,2)>1
                [ValueFirst,ValueLast,ValueAffiliation,ValueORCID,nAuthors2]=ExtractAuthor(ValueTemp,1,2);
                n4=2;
                TestTemp=0;
                while n4<=nAuthors&&TestTemp==0
                    [ValueFirst,ValueLast2,ValueAffiliation,ValueORCID,nAuthors2]=ExtractAuthor(ValueTemp,n4,2);
                    ValueLastTemp=double(ValueLast);
                    ValueLastTemp2=double(ValueLast2);
                    ValueTemp6=min([size(ValueLastTemp,2) size(ValueLastTemp2,2)]);
                    TestTemp2=0;
                    n6=1;
                    while n6<=ValueTemp6&&TestTemp2==0
                        if ValueLastTemp(1,n6)>ValueLastTemp2(1,n6)
                            TestTemp2=1;
                        else
                            n6=n6+1;
                        end
                    end
                    if TestTemp2==0
                        if size(ValueLastTemp,2)>size(ValueLastTemp2,2)
                            TestTemp2=1;
                        end
                    end
                    if TestTemp2==1
                        TestTemp=1;
                    else
                        n4=n4+1;
                    end
                    ValueLast=ValueLast2;
                end
                if TestTemp==1
                    if ValueArticleType3==1
                        if nAuthors<=1000
                            VecResultsAuthorsNameOriginal(nAuthors+1,2)=VecResultsAuthorsNameOriginal(nAuthors+1,2)+1;
                        else
                            VecResultsAuthorsNameOriginal(1002,2)=VecResultsAuthorsNameOriginal(1002,2)+1;
                        end
                    end
                    if nAuthors<=1000
                        VecResultsAuthorsNameAll(nAuthors+1,2)=VecResultsAuthorsNameAll(nAuthors+1,2)+1;
                    else
                        VecResultsAuthorsNameAll(1002,2)=VecResultsAuthorsNameAll(1002,2)+1;
                    end
                else
                    if ValueArticleType3==1
                        if nAuthors<=1000
                            VecResultsAuthorsNameOriginal(nAuthors+1,1)=VecResultsAuthorsNameOriginal(nAuthors+1,1)+1;
                        else
                            VecResultsAuthorsNameOriginal(1002,1)=VecResultsAuthorsNameOriginal(1002,1)+1;
                        end
                    end
                    if nAuthors<=1000
                        VecResultsAuthorsNameAll(nAuthors+1,1)=VecResultsAuthorsNameAll(nAuthors+1,1)+1;
                    else
                        VecResultsAuthorsNameAll(1002,1)=VecResultsAuthorsNameAll(1002,1)+1;
                    end
                end
            else
                if ValueArticleType3==1
                    if nAuthors<=1000
                        VecResultsAuthorsNameOriginal(nAuthors+1,2)=VecResultsAuthorsNameOriginal(nAuthors+1,2)+1;
                    else
                        VecResultsAuthorsNameOriginal(1002,2)=VecResultsAuthorsNameOriginal(1002,2)+1;
                    end
                end
                if nAuthors<=1000
                    VecResultsAuthorsNameAll(nAuthors+1,2)=VecResultsAuthorsNameAll(nAuthors+1,2)+1;
                else
                    VecResultsAuthorsNameAll(1002,2)=VecResultsAuthorsNameAll(1002,2)+1;
                end
            end
        end   
        if mod(n1,50)==0
            ValueFile=['ResultsNameAuthorsTemp' num2str(n5) '.mat'];
            save([ValueFolderTemp ValueFile]);
        end
    end
end
ValueFile=['ResultsNameAuthors' num2str(n5) '.mat'];
save([ValueFolderTemp ValueFile],'VecResultsAuthorsNameOriginal','VecResultsAuthorsNameAll');
ValueClock=clock;
disp(['End of the processing at ' num2str(ValueClock(1,4)) ':' num2str(ValueClock(1,5)) ':' num2str(ValueClock(1,6)) ' for journal ' num2str(n5)]);
    
    